﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using MultiTenant.SeparateSchema.Api.Data;

namespace MultiTenant.SeparateSchema.Api.Extensions;

public static class ModelCacheKeyExtensions
{
	public static DbContextOptionsBuilder UseTenantModelCacheKey(
		this DbContextOptionsBuilder optionsBuilder)
	{
		optionsBuilder.ReplaceService<IModelCacheKeyFactory, TenantModelCacheKeyFactory>();
		return optionsBuilder;
	}
}
